<template>
  <div class="apply">
    <div class="applyheader">
      <div>申请传媒入住</div>
    </div>
    <div class="applycontent">
      <div class="applyaline">
        <div class="applyleft">
          <span class="red">*</span>传媒分类:
        </div>
        <div class="applyright">
          <el-radio-group v-model="mediaclass" @change="qiehuan">
            <el-radio :label="1">微信营销</el-radio>
            <el-radio :label="2">微博营销</el-radio>
            <el-radio :label="3">短视频</el-radio>
            <el-radio :label="4">直播</el-radio>
            <el-radio :label="5">自媒体营销</el-radio>
            <el-radio :label="6">软文</el-radio>
          </el-radio-group>
        </div>
      </div>
      <div v-if="mediaclass==1">
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>所属分类:
          </div>
          <div class="applyright">
            <el-radio-group v-model="theme_index">
              <el-radio
                v-for="(item,index) in mediadata"
                :key="item.theme_id"
                :label="index"
              >{{item.theme_name}}</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>账号名称:
          </div>
          <div class="applyright">
            <el-input v-model="goods_title" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>标题简介:
          </div>
          <div class="applyright">
            <el-input v-model="goods_title_about" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>微信号:
          </div>
          <div class="applyright">
            <el-input v-model="weixin_ID" maxlength="20" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>媒体领域:
          </div>
          <div class="applyright">
            <el-select v-model="filed" placeholder="请选择">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>粉丝数:
          </div>
          <div class="applyright">
            <el-input v-model="fans_num" maxlength="10" placeholder="请输入粉丝数"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>是否需要预约:
          </div>
          <div class="applyright">
            <el-radio-group v-model="isorder">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="applyaline" v-for="item in mediadatatitle" :key="item.priceclassify_id">
          <div class="applyleft">
            <span class="red">*</span>
            {{item.priceclassify_name}}价格:
          </div>
          <div class="applyright">
            <el-input v-model="price_data[item.priceclassify_id]" placeholder="请输入价格"></el-input>
          </div>
        </div>
      </div>
      <div v-if="mediaclass==2">
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>所属分类:
          </div>
          <div class="applyright">
            <el-radio-group v-model="theme_index">
              <el-radio
                v-for="(item,index) in weiboGoodsAttribute"
                :key="item.theme_id"
                :label="index"
              >{{item.theme_name}}</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>微博名称:
          </div>
          <div class="applyright">
            <el-input v-model="goods_title" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>标题简介:
          </div>
          <div class="applyright">
            <el-input v-model="goods_title_about" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>微博链接:
          </div>
          <div class="applyright">
            <el-input v-model="weixin_ID" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>媒体领域:
          </div>
          <div class="applyright">
            <el-select v-model="filed" placeholder="请选择">
              <el-option
                v-for="item in weiboGoodsAttribute[theme_index].filed"
                :key="item.filed_id"
                :label="item.filed_name"
                :value="item.filed_id"
              ></el-option>
            </el-select>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>是否需要预约:
          </div>
          <div class="applyright">
            <el-radio-group v-model="isorder">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>认证类型:
          </div>
          <div class="applyright">
            <el-radio-group v-model="authtype_id">
              <el-radio :label="1">已认证</el-radio>
              <el-radio :label="2">未认证</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div
          class="applyaline"
          v-for="item in weiboGoodsAttribute[theme_index].priceclassify"
          :key="item.priceclassify_id"
        >
          <div class="applyleft">
            <span class="red">*</span>
            {{item.priceclassify_name}}价格:
          </div>
          <div class="applyright">
            <el-input v-model="price_data[item.priceclassify_id]" maxlength="8" placeholder="请输入价格"></el-input>
          </div>
        </div>
      </div>
      <!-- 短视频 -->
      <div v-if="mediaclass==3">
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>平台选择:
          </div>
          <div class="applyright">
            <el-select v-model="platform_id" placeholder="请选择">
              <el-option
                v-for="item in videoGoodsAttribute[0].platform"
                :key="item.platform_id"
                :label="item.platform_name"
                :value="item.platform_id"
              ></el-option>
            </el-select>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>商品名称:
          </div>
          <div class="applyright">
            <el-input v-model="goods_title" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>标题简介:
          </div>
          <div class="applyright">
            <el-input v-model="goods_title_about" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>房间号/账号ID:
          </div>
          <div class="applyright">
            <el-input v-model="weixin_ID" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>粉丝数:
          </div>
          <div class="applyright">
            <el-input v-model="fans_num" maxlength="15" placeholder="请输入粉丝数量"></el-input>
          </div>
        </div>
        <div
          class="applyaline"
          v-for="item in videoGoodsAttribute[0].priceclassify"
          :key="item.priceclassify_id"
          v-show="item.tag == tag"
        >
          <div class="applyleft">
            <span class="red">*</span>
            {{item.priceclassify_name}}价格:
          </div>
          <div class="applyright">
            <el-input v-model="price_data[item.priceclassify_id]" maxlength="8" placeholder="请输入价格"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>媒体领域:
          </div>
          <div class="applyright">
            <el-select v-model="filed" placeholder="请选择">
              <el-option
                v-for="item in videoGoodsAttribute[0].filed"
                :key="item.filed_id"
                :label="item.filed_name"
                :value="item.filed_id"
              ></el-option>
            </el-select>
          </div>
        </div>
      </div>
      <div v-if="mediaclass==4">
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>平台选择:
          </div>
          <div class="applyright">
            <el-select v-model="platform_id" placeholder="请选择">
              <el-option
                v-for="item in videoGoodsAttribute[1].platform"
                :key="item.platform_id"
                :label="item.platform_name"
                :value="item.platform_id"
              ></el-option>
            </el-select>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>商品名称:
          </div>
          <div class="applyright">
            <el-input v-model="goods_title" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>标题简介:
          </div>
          <div class="applyright">
            <el-input v-model="goods_title_about" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>房间号/账号ID:
          </div>
          <div class="applyright">
            <el-input v-model="weixin_ID" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>粉丝数:
          </div>
          <div class="applyright">
            <el-input v-model="fans_num" maxlength="10" placeholder="请输入粉丝数量"></el-input>
          </div>
        </div>
        <div
          class="applyaline"
          v-for="item in videoGoodsAttribute[1].priceclassify"
          :key="item.priceclassify_id"
          v-show="item.tag == tag"
        >
          <div class="applyleft">
            <span class="red">*</span>
            {{item.priceclassify_name}}价格:
          </div>
          <div class="applyright">
            <el-input v-model="price_data[item.priceclassify_id]" maxlength="8" placeholder="请输入价格"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>媒体领域:
          </div>
          <div class="applyright">
            <el-select v-model="filed" placeholder="请选择">
              <el-option
                v-for="item in videoGoodsAttribute[1].filed"
                :key="item.filed_id"
                :label="item.filed_name"
                :value="item.filed_id"
              ></el-option>
            </el-select>
          </div>
        </div>
      </div>
      <div v-if="mediaclass==5">
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>所属分类:
          </div>
          <div class="applyright">
            <el-radio-group v-model="theme_index">
              <el-radio
                v-for="(item,index) in selfmediaGoodsAttribute"
                :key="item.theme_id"
                :label="index"
              >{{item.theme_name}}</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>平台选择:
          </div>
          <div class="applyright">
            <el-select v-model="platform_id" placeholder="请选择">
              <el-option
                v-for="item in selfmediaGoodsAttribute[1].platform"
                :key="item.platform_id"
                :label="item.platform_name"
                :value="item.platform_id"
              ></el-option>
            </el-select>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>商品名称:
          </div>
          <div class="applyright">
            <el-input v-model="goods_title" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>标题简介:
          </div>
          <div class="applyright">
            <el-input v-model="goods_title_about" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>媒体领域:
          </div>
          <div class="applyright">
            <el-select v-model="filed" placeholder="请选择">
              <el-option
                v-for="item in selfmediaGoodsAttribute[theme_index].filed"
                :key="item.filed_id"
                :label="item.filed_name"
                :value="item.filed_id"
              ></el-option>
            </el-select>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>粉丝数量:
          </div>
          <div class="applyright">
            <el-input v-model="fans_num" placeholder="请输入粉丝数量"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>价格:
          </div>
          <div class="applyright">
            <el-input v-model="price" maxlength="8" placeholder="请输入商品价格"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>是否需要预约:
          </div>
          <div class="applyright">
            <el-radio-group v-model="isorder">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
      </div>
      <div v-if="mediaclass==6">
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>商品名称:
          </div>
          <div class="applyright">
            <el-input v-model="goods_title" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>标题简介:
          </div>
          <div class="applyright">
            <el-input v-model="goods_title_about" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>链接网址:
          </div>
          <div class="applyright">
            <el-input v-model="web_link" placeholder="请输入商品名称"></el-input>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>周末是否发稿:
          </div>
          <div class="applyright">
            <el-radio-group v-model="weekend_send">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>新闻源:
          </div>
          <div class="applyright">
            <el-radio-group v-model="news_source">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>媒体领域:
          </div>
          <div class="applyright">
            <el-select v-model="filed" placeholder="请选择">
              <el-option
                v-for="item in softarticleGoodsAttribute[0].filed"
                :key="item.filed_id"
                :label="item.filed_name"
                :value="item.filed_id"
              ></el-option>
            </el-select>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>平台选择:
          </div>
          <div class="applyright">
            <el-select v-model="platform_id" placeholder="请选择">
              <el-option
                v-for="item in softarticleGoodsAttribute[0].platform"
                :key="item.platform_id"
                :label="item.platform_name"
                :value="item.platform_id"
              ></el-option>
            </el-select>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>行业选择:
          </div>
          <div class="applyright">
            <el-select v-model="industry_id" placeholder="请选择">
              <el-option
                v-for="item in softarticleGoodsAttribute[0].industry"
                :key="item.industry_id"
                :label="item.industry_name"
                :value="item.industry_id"
              ></el-option>
            </el-select>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>发稿速度:
          </div>
          <div class="applyright">
            <el-select v-model="sendspeed_id" placeholder="请选择">
              <el-option
                v-for="item in softarticleGoodsAttribute[0].sendspeed"
                :key="item.sendspeed_id"
                :label="item.sendspeed_name"
                :value="item.sendspeed_id"
              ></el-option>
            </el-select>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>入口种类:
          </div>
          <div class="applyright">
            <el-select v-model="entryclassify_id" placeholder="请选择">
              <el-option
                v-for="item in softarticleGoodsAttribute[0].entryclassify"
                :key="item.entryclassify_id"
                :label="item.entryclassify_name"
                :value="item.entryclassify_id"
              ></el-option>
            </el-select>
          </div>
        </div>
        <div class="applyaline">
          <div class="applyleft">
            <span class="red">*</span>价格:
          </div>
          <div class="applyright">
            <el-input v-model="price" maxlength="8" placeholder="请输入商品价格"></el-input>
          </div>
        </div>
      </div>
      <div class="applyaline relative">
        <span class="tishi">价格为0或空的时候表示不接单</span>
        <div class="applyleft">
          <span class="red">*</span>联系QQ:
        </div>
        <div class="applyright">
          <el-input v-model="qq_ID" maxlength="15" placeholder="请输入联系QQ"></el-input>
        </div>
      </div>
      <div class="applyaline">
        <div class="applyleft">
          <span class="red">*</span>地区:
        </div>
        <div class="applyright">
          <el-select v-model="region_id" placeholder="请选择">
            <el-option
              v-for="item in region"
              :key="item.region_id"
              :label="item.region_name"
              :value="item.region_id"
            ></el-option>
          </el-select>
        </div>
      </div>
      <div class="applyaline">
        <div class="applyleft">商家备注:</div>
        <div class="applyright">
          <el-input v-model="remarks" type="textarea" resize="none" placeholder="请输入备注"></el-input>
        </div>
      </div>
      <div class="applyaline">
        <div class="applyleft"></div>
        <div class="applyright">
          <el-button type="primary" @click="btn" :disabled="iswait">立即申请</el-button>
          <div class="clause">
            <p>
              我已阅读并同意
              <span class="blue">《媒介兔用户出售协议》</span>
            </p>
            <p>
              温馨提示 :出售传媒成功交易后,媒介兔将收取传媒成交价格的
              <span class="red">10%</span>作为手续费
            </p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { gettoken } from "@@/assets/commen.js";
export default {
  layout: "user",
  async asyncData({ app }) {
    let { data } = await app.$axios.get("/getGoodsAttribute");
    return { mediadata: data.data[0].theme,
      region : data.data[0].theme[0].region, //地区列表数据
      weixinGoodsAttribute: data.data[0].theme,
      weiboGoodsAttribute :data.data[1].theme,
      videoGoodsAttribute : data.data[2].theme,
      selfmediaGoodsAttribute : data.data[3].theme,
      softarticleGoodsAttribute : data.data[4].theme,};
  },
  data() {
    return {
      mediaclass: 1,
      theme_index: 0,
      filed: "", //领域
      isorder: "", //是否预约
      platform_id: "", //选择平台
      goods_title: "", //商品名称
      goods_title_about: "", //商品简介
      weixin_ID: "", //微信账号   微博链接
      fans_num: "", //粉丝数量
      region_id: "", //地区编号ID
      remarks: "", //商家备注
      qq_ID: "", //联系QQ
      price_data: {}, //价格种类信息
      price: "", //自媒体 软文 商品价格
      iswait: false,

      web_link: "", //软文链接
      authtype_id: "", //微博认证类型
      weekend_send: "", //软文 是否周末发稿
      news_source: "", //软文 是否新闻源
      sendspeed_id: "", //软文 发稿速度
      industry_id: "", //行业选择
      entryclassify_id: "" //入口种类
    };
  },
  methods: {
    btn() {
      if(this.iswait == true){return}
      this.iswait == true
      this.mediadata[this.theme_index].priceclassify.forEach(item => {            //价格种类若不选则为0
        if(this.price_data[item.priceclassify_id]===undefined){
          this.price_data[item.priceclassify_id]=0
        }
      });
      console.log(this.mediaclass, "mediaclass");
      if (this.mediaclass == 1) {
        gettoken()
          .then(val => {
            //申请微信营销按钮
            return this.$axios.post(
              "/createGoods",
              {
                theme_id: this.mediadata[this.theme_index].theme_id,
                modular_id: 1,
                title: this.goods_title,
                title_about: this.goods_title_about,
                filed_id: this.filed,
                qq_ID: this.qq_ID,
                remarks: this.remarks,
                price_json: JSON.stringify(this.price_data),
                region_id: this.region_id,
                weixin_ID: this.weixin_ID,
                fans_num: this.fans_num,
                reserve_status: this.isorder
              },
              { headers: { Authorization: "Bearer" + val } }
            );
          })
          .then(res => {
            console.log(res);
            alert('申请成功')
            this.price_data = {};
          })
          .catch(err => {
            console.log(err.response);
            this.iswait = false;
            this.price_data={}
          });  
      }
      if (this.mediaclass == 2) {
        gettoken()
          .then(val => {
            //申请微博营销按钮
            return this.$axios.post(
              "/createGoods",
              {
                theme_id: this.weiboGoodsAttribute[this.theme_index].theme_id,
                modular_id: 2,
                title: this.goods_title,
                title_about: this.goods_title_about,
                filed_id: this.filed,
                qq_ID: this.qq_ID,
                remarks: this.remarks,
                price_json: JSON.stringify(this.price_data),
                link:this.weixin_ID,
                region_id: this.region_id,
                reserve_status: this.isorder,
              },
              { headers: { Authorization: "Bearer" + val } }
            );
          })
          .then(res => {
            console.log(res);
            alert("成功");
            this.price_data = {};
          })
          .catch(err => {
            console.log(err.response);
            this.iswait = false;
            this.price_data={}
          });
      }
      if (this.mediaclass == 3 || this.mediaclass == 4) {
        gettoken()
          .then(val => {
            let theme_id;
            if (this.mediaclass == 3) {
              theme_id = this.videoGoodsAttribute[0].theme_id;
            } else if (this.mediaclass == 4) {
              theme_id = this.videoGoodsAttribute[1].theme_id;
            }
            //申请视频销按钮
            return this.$axios.post(
              "/createGoods",
              {
                theme_id: theme_id,
                modular_id: 3,
                title: this.goods_title,
                title_about: this.goods_title_about,
                filed_id: this.filed,
                qq_ID: this.qq_ID,
                remarks: this.remarks,
                price_json: JSON.stringify(this.price_data),
                room_ID:this.weixin_ID,
                fans_num:this.fans_num,
                platform_id:this.platform_id,
                region_id: this.region_id,
              },
              { headers: { Authorization: "Bearer" + val } }
            );
          })
          .then(res => {
            console.log(res);
            alert("成功");
            this.price_data = {};
          })
          .catch(err => {
            console.log(err.response);
            this.iswait = false;
            this.price_data = {};
          });
      }
      if (this.mediaclass == 5) {
        gettoken()
          .then(val => {
            //申请网络营销按钮
            return this.$axios.post(
              "/createGoods",
              {
                theme_id: this.selfmediaGoodsAttribute[this.theme_index].theme_id,
                modular_id: 4,
                title: this.goods_title,
                title_about: this.goods_title_about,
                filed_id: this.filed,
                qq_ID: this.qq_ID,
                remarks: this.remarks,
                price_json: JSON.stringify(this.price_data),
                reserve_status: this.isorder,
                platform_id: this.platform_id,
                region_id: this.region_id,
              },
              { headers: { Authorization: "Bearer" + val } }
            );
          })
          .then(res => {
            console.log(res);
            alert("成功");
            this.price_data = {};
          })
          .catch(err => {
            console.log(err.response);
            this.iswait = false;
            this.price_data = {};
          });
      }
      if (this.mediaclass == 6) {
        gettoken()
          .then(val => {
            //申请软文营销按钮
            return this.$axios.post(
              "/createGoods",
              {
                theme_id: this.softarticleGoodsAttribute[0].theme_id,
                goods_title: this.goods_title,
                web_link: this.web_link,
                weekend_send: this.weekend_send,
                news_source: this.news_source,
                goods_title_about: this.goods_title_about,
                filed_id: this.filed,
                platform_id: this.platform_id,
                industry_id: this.industry_id,
                sendspeed_id: this.sendspeed_id,
                entryclassify_id: this.entryclassify_id,
                region_id: this.region_id,
                remarks: this.remarks,
                qq_ID: this.qq_ID,
                price_data: JSON.stringify({ 1: this.price })
              },
              { headers: { Authorization: "Bearer" + val } }
            );
          })
          .then(res => {
            console.log(res);
            alert("成功");
            this.price_data = {};
          })
          .catch(err => {
            console.log(err.response);
            this.iswait = false;
            this.price_data = {};
          });
      }
    },
    qiehuan(val) {
      this.platform_id = this.filed = this.goods_title = this.isorder = this.weixin_ID =
        "";
      this.price_data = {};
      if(val==1){
        this.mediadata = this.weixinGoodsAttribute
      }else if(val==2){
        this.mediadata = this.weiboGoodsAttribute
      }else if(val==3||val==4){
        this.mediadata = this.videoGoodsAttribute
      }else if(val==5){
        this.mediadata = this.selfmediaGoodsAttribute
      }else if(val==6){
        this.mediadata = this.softarticleGoodsAttribute
      }
      
    }
  },
  mounted() {
  },
  computed: {
    options: function() {
      //媒体类型多选框
      let opt = [];
      this.mediadata[this.theme_index].filed.forEach(item => {
        opt.push({ value: item.filed_id, label: item.filed_name });
      });
      return opt;
    },
    mediadatatitle: function() {
      return this.mediadata[this.theme_index].priceclassify;
    },
    tag: function() {
      if (this.platform_id == 4) {
        return "小红书";
      } else if (this.platform_id == 2) {
        return "bilibili";
      } else if (this.platform_id == 10) {
        return "淘宝直播";
      } else {
        return "default";
      }
    }
  }
};
</script>

<style scoped>
.applycontent {
  padding-bottom: 30px;
}
.el-input {
  width: 320px;
}
.apply {
  background-color: #fff;
  border-radius: 5px;
}
.applyheader {
  height: 55px;
  border-bottom: 1px #d2d2d2 solid;
}
.applyheader > div {
  width: 120px;
  height: 54px;
  margin-left: 20px;
  padding: 0 10px;
  line-height: 54px;
  border-bottom: 2px #5141ed solid;
}
.applyleft {
  width: 200px;
  display: flex;
  justify-content: flex-end;
  margin-right: 20px;
}
.applyaline {
  margin-top: 30px;
  display: flex;
}
.clause {
  margin-left: 20px;
  font-size: 12px;
  color: #888;
  float: right;
}
.el-select {
  width: 320px;
}
.tishi {
  position: absolute;
  font-size: 12px;
  font-family: MicrosoftYaHei;
  font-weight: 400;
  color: rgba(189, 33, 33, 1);
  right: 220px;
  top: -130px;
}
.relative {
  position: relative;
}
.el-textarea {
  width: 320px;
}
</style>
